using System;
using System.Collections;
using System.Collections.Generic;

namespace Timesheet
{
    class OpenAirTimesheetItem : IOpenAirTimeSheetItem
    {
        private string _projectCode;
        private string _taskCode;
        private string _date;

        public OpenAirTimesheetItem(string projectCode, string taskCode, string date)
        {
            this._projectCode = projectCode;
            this._taskCode = taskCode;
            this._date = date;
        }

        public string ProjectCode
        {
            get { return _projectCode; }
            set { _projectCode = value; }
        }

        public override bool Equals(Object obj)
        {
            if (obj == null) return false;
            OpenAirTimesheetItem item = obj as OpenAirTimesheetItem;
            return (this._projectCode.Equals(item._projectCode) && this._taskCode.Equals(item._taskCode) && this._date.Equals(item._date));
        }

        public override int GetHashCode()
        {
            return _projectCode.GetHashCode() + _taskCode.GetHashCode() + _date.GetHashCode();
        }

        public string TaskCode
        {
            get { return _taskCode; }
            set { _taskCode = value; }
        }

        public string Date
        {
            get { return _date; }
            set { _date = value; }
        }

        public override string ToString()
        {
            return _projectCode + _taskCode + _date;
        }
    }
}
